#!/usr/bin/perl 

use strict;

use DBI;
use CGI;
# use TTrakerSite;
use TTraker;

my $dbh;
& initialize_dbi;
my $form_ref = &parse_input;
& print_header;

my %FORM_DATA = %$form_ref;
 
my $num = $FORM_DATA{'empNum'};
my $name = $FORM_DATA{'empName'};
my $job = $FORM_DATA{'empJob'};
my $loc = $FORM_DATA{'empLoc'};
my $start = $FORM_DATA{'dateStart'};
my $end = $FORM_DATA{'dateEnd'};
my $agency = $FORM_DATA{'agencyID'};
my $facility = $FORM_DATA{'facilityID'};

my $msg = "";


& generate_agency_temp_table ($num, $name, $loc, $start, $end, $agency, $facility);

my $msg = "Agency data generated: agency_hrs_temp $start thru $end<br/>";

pay_activity_screen_from_pm  ($num, $name, $job, $loc, $msg);

db_disconnect();

############### SUBROUTINES FOLLOW ###############

sub generate_agency_temp_table
{
	my $num = $_[0];
	my $name = $_[1];
	my $loc = $_[2];
	my $start = $_[3];
	my $end = $_[4];
	my $agency = $_[5];
	my $facility = $_[6];
	clear_agency_hrs_temp();
	write_agency_hrs_temp($start, $end, $agency, $facility);
}


sub trak_03_sup_activity_selection_with_message
{
my $loc = $_[0];
my $date = $_[1];
my $num =  $_[2];
my $name =  $_[3];
# my $msg = & get_message ($num);
# my @dis = & get_disabled_list ($num);
# my @col = & get_dimmed_list ($num);
my @dis = ("", "", "", "", "", "", "disabled=\"disabled\"", "disabled=\"disabled\"","disabled=\"disabled\"");
my @col = ("dis","en","en","en","en","en","dis","dis"); 

print <<ENDHEADER;
<html>
<head>
<link rel='stylesheet' type='text/css' href='${css_ref}trak.css' />
<script type='text/javascript' src='${js_ref}trak.js'></script>
<title>trak_02_activity_select</title>
</head>
<body onload='startTime()'>
<h2><center>${banner}</center></h2>
<hr/>
<div id='clock'></div>
<div id='box1'>
Employee Number: <br/><br/>
Employee Name: <br/><br/>
Activity:
</div>
<form id='box2' autocomplete='off' name='activity' action='${cgi_ref}trak_02_sup_activity.pl' method='post'>
<input type="hidden" name=empNum value='$num'/>
<input type="hidden" name=empName value='$name'/>
<input type="hidden" name=empLoc value='$loc'/>
<span>$num</span><br/><br/>
<span>$name</span></b><br/><br/>
<input $dis[1]type="radio" name="activity" value="1" checked="checked"/>&nbsp<$col[1]> Confirm Daily Payroll</$col[1]><br/>
<input $dis[2]type="radio" name="activity" value="2"/>&nbsp<$col[2]> Check this Week's Payroll</$col[2]><br/>
<input $dis[3] type="radio" name="activity" value="3"/>&nbsp<$col[3]> Check last Week's Payroll</$col[3]><br/>
<input $dis[4] type="radio" name="activity" value="4"/>&nbsp<$col[4]> Confirm Stat Holiday</$col[4]><br/>
<input $dis[5] type="radio" name="activity" value="5"/>&nbsp<$col[5]> Book Employee Vacation</$col[5]><br/>
<input $dis[6] type="radio" name="activity" value="6"/>&nbsp<$col[6]> TBA</$col[6]><br/>
<input $dis[6] type="radio" name="activity" value="7"/>&nbsp<$col[7]> TBA<br/>
<br/>
<input type='submit' value='Proceed'>
<br/><br/>
<a href="${cgi_ref}trak_00_start_up.pl">Return to Log-In</a>
<br/><br/>
<b id="info">$msg</b>
</form>
</body>
</html>

ENDHEADER
}


	

